<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"yoursite.com","root":"/","scheme":"Gemini","version":"7.7.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="以下教程仅适用于win10环境，安装以Matlab 2017b为例一、Matlab的作用因为博主本科在校期间参与数学建模竞赛，并作为编程队员，Matlab是必须掌握的编程语言。在数学建模竞赛中，Matlab主要发挥的作用包括数学计算，模型求解以及可视化图形绘制。">
<meta property="og:type" content="article">
<meta property="og:title" content="Matlab安装教程">
<meta property="og:url" content="http://yoursite.com/2020/02/12/Matlab%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/index.html">
<meta property="og:site_name" content="杨文昊的个人博客">
<meta property="og:description" content="以下教程仅适用于win10环境，安装以Matlab 2017b为例一、Matlab的作用因为博主本科在校期间参与数学建模竞赛，并作为编程队员，Matlab是必须掌握的编程语言。在数学建模竞赛中，Matlab主要发挥的作用包括数学计算，模型求解以及可视化图形绘制。">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212719529-257398164.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212746326-843939953.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212812111-1863935724.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212917786-104551208.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213247371-1135438213.jpg">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213300771-502055264.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213336258-1057227094.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213404125-168800029.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213424537-1031916014.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213501889-548808556.png">
<meta property="og:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213537839-972029521.png">
<meta property="og:image" content="https://tse3-mm.cn.bing.net/th/id/OIP.q_AHtHnA6emmUEbVW7CSlAAAAA?w=188&h=188&c=7&o=5&dpr=1.5&pid=1.7">
<meta property="og:image" content="https://tse4-mm.cn.bing.net/th/id/OIP.2vHN_wwhiwgI4uYi5x2APQAAAA?w=202&h=202&c=7&o=5&dpr=1.5&pid=1.7">
<meta property="article:published_time" content="2020-02-11T21:11:42.000Z">
<meta property="article:modified_time" content="2020-02-12T04:37:22.268Z">
<meta property="article:author" content="Alpha Yang">
<meta property="article:tag" content="Matlab">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212719529-257398164.png">

<link rel="canonical" href="http://yoursite.com/2020/02/12/Matlab%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true
  };
</script>

  <title>Matlab安装教程 | 杨文昊的个人博客</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

<link rel="alternate" href="/atom.xml" title="杨文昊的个人博客" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">杨文昊的个人博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <p class="site-subtitle">愿你出走半生，归来仍是少年。</p>
  </div>

  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-fw fa-home"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-fw fa-user"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-fw fa-tags"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-fw fa-th"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-fw fa-archive"></i>归档</a>

  </li>
  </ul>

</nav>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content">
            

  <div class="posts-expand">
      
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block " lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2020/02/12/Matlab%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/IMG_1979(20200206-160439).JPG">
      <meta itemprop="name" content="Alpha Yang">
      <meta itemprop="description" content="世间万物，唯代码美食，不能辜负。">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="杨文昊的个人博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Matlab安装教程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-02-11 21:11:42" itemprop="dateCreated datePublished" datetime="2020-02-11T21:11:42Z">2020-02-11</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-02-12 04:37:22" itemprop="dateModified" datetime="2020-02-12T04:37:22Z">2020-02-12</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%AE%9E%E7%94%A8%E5%B7%A5%E5%85%B7/" itemprop="url" rel="index">
                    <span itemprop="name">实用工具</span>
                  </a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E5%AE%9E%E7%94%A8%E5%B7%A5%E5%85%B7/Matlab/" itemprop="url" rel="index">
                    <span itemprop="name">Matlab</span>
                  </a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h4 id="以下教程仅适用于win10环境，安装以Matlab-2017b为例"><a href="#以下教程仅适用于win10环境，安装以Matlab-2017b为例" class="headerlink" title="以下教程仅适用于win10环境，安装以Matlab 2017b为例"></a>以下教程仅适用于win10环境，安装以Matlab 2017b为例</h4><h3 id="一、Matlab的作用"><a href="#一、Matlab的作用" class="headerlink" title="一、Matlab的作用"></a>一、Matlab的作用</h3><p>因为博主本科在校期间参与数学建模竞赛，并作为编程队员，Matlab是必须掌握的编程语言。在数学建模竞赛中，Matlab主要发挥的作用包括数学计算，模型求解以及可视化图形绘制。<a id="more"></a>其实除此之外，Matlab更是所有工科专业所必须的模型仿真以及参数调制的软件，它几乎能实现问题的求解，包括电磁场分解，神经网络，视屏图像处理等等功能。今天我们来详细讲解Matlab的安装。</p>
<h3 id="二、软件准备"><a href="#二、软件准备" class="headerlink" title="二、软件准备"></a>二、软件准备</h3><p>本文采取种子下载的方式，较安全。<br>Torrent种子下载器的百度网盘链接：</p>
<blockquote>
<p>链接：<a href="https://pan.baidu.com/s/1O0rRAlQM6nfsQTxsaNgxOg" target="_blank" rel="noopener">https://pan.baidu.com/s/1O0rRAlQM6nfsQTxsaNgxOg</a><br>提取码：0ubq</p>
</blockquote>
<p>Matlab2018b种子文件(持续更新)</p>
<blockquote>
<p>链接：<a href="https://pan.baidu.com/s/1uTsnFpCbfc5Te5gX2LFCsQ" target="_blank" rel="noopener">https://pan.baidu.com/s/1uTsnFpCbfc5Te5gX2LFCsQ</a><br>提取码：ed74</p>
</blockquote>
<p>下载解压后，将种子放进Torrent下载器中下载后，本地上有三个文件。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212719529-257398164.png" alt=""><br>两个光盘安装文件，一个破解文件。</p>
<h3 id="三、正式安装"><a href="#三、正式安装" class="headerlink" title="三、正式安装"></a>三、正式安装</h3><ol>
<li>点击dvd1的exe文件。</li>
<li>选择<code>使用文件安装秘钥</code>，点击<code>下一步</code>。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212746326-843939953.png" alt=""></li>
<li>允许用户协议，选择<code>是</code>，点击<code>下一步</code>。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212812111-1863935724.png" alt=""></li>
<li>选择<code>我已有我的许可证的文件安装秘钥</code>，输入序列号<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">09806</span><span class="number">-07443</span><span class="number">-53955</span><span class="number">-64350</span><span class="number">-21751</span><span class="number">-41297</span></span><br></pre></td></tr></table></figure>
<img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606212917786-104551208.png" alt=""></li>
<li>接下来按照默认即可，点击安装，等待安装完成。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213247371-1135438213.jpg" alt=""></li>
<li>安装到一半会出现下面情况，点击确定。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213300771-502055264.png" alt=""></li>
<li>我们到此电脑目录下，弹出DVD1，并继续安装dvd2的文件即可，到此安装文件进度条可到100%。<strong>安装完成</strong></li>
</ol>
<h3 id="四、软件破解"><a href="#四、软件破解" class="headerlink" title="四、软件破解"></a>四、软件破解</h3><ol>
<li>解压破解文件夹，打开破解文件夹的<code>R2017b</code>，将破解的补丁文件<code>bin</code>复制到安装目录<code>/MATLAB/R2017b/</code>下覆盖原文件。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213336258-1057227094.png" alt=""></li>
<li>将破解文件夹下的<code>license_server.lic</code>和<code>license_standalone.lic</code>复制到安装目录<code>/MATLAB/R2017b/licenses</code>下覆盖原文件。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213404125-168800029.png" alt=""></li>
</ol>
<h3 id="五、软件激活"><a href="#五、软件激活" class="headerlink" title="五、软件激活"></a>五、软件激活</h3><ol>
<li>点击<code>/bin/win64/</code>里面的<code>active_matlab</code>,进行激活。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213424537-1031916014.png" alt=""></li>
<li>选择<code>在不使用Internet的情况下手动激活</code>。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213501889-548808556.png" alt=""></li>
<li>然后在<code>输入许可文件的完整安装路径</code>的选项下选择文件<code>license_standalone.lic</code>。<br><img src="https://images2018.cnblogs.com/blog/1377919/201806/1377919-20180606213537839-972029521.png" alt=""></li>
<li>点击<code>下一步</code>，激活完成。</li>
</ol>
<h3 id="六、Matlab推荐材料"><a href="#六、Matlab推荐材料" class="headerlink" title="六、Matlab推荐材料"></a>六、Matlab推荐材料</h3><ol>
<li>视屏教学材料，台大的郭彦甫老师授课，讲解清晰透彻，适合刚入门的小白学习，14讲内容，看完理解之后，基本内容就没有问题了，考虑到国内无法观看youtube平台的视屏，所以我选择了b站上别的up主搬运的视屏。<a href="https://www.bilibili.com/video/av68228488?from=search&amp;seid=10223858992775987688" target="_blank" rel="noopener">https://www.bilibili.com/video/av68228488?from=search&amp;seid=10223858992775987688</a></li>
<li>MATLAB2018从入门到精通，关于matlab的知识十分全面，可以与视屏配套使用。<br><img src="https://tse3-mm.cn.bing.net/th/id/OIP.q_AHtHnA6emmUEbVW7CSlAAAAA?w=188&h=188&c=7&o=5&dpr=1.5&pid=1.7" alt=""></li>
<li>MATLAB智能算法30个案例分析，这里面有许多高级的算法，遗传算法，蚁群算法，退火算法，可以作为进阶教材学习。<br><img src="https://tse4-mm.cn.bing.net/th/id/OIP.2vHN_wwhiwgI4uYi5x2APQAAAA?w=202&h=202&c=7&o=5&dpr=1.5&pid=1.7" alt=""></li>
</ol>

    </div>

    
    
    
        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

            <div class="social-item">
              <a target="_blank" class="social-link" href="/atom.xml">
                <span class="icon">
                  <i class="fa fa-rss"></i>
                </span>

                <span class="label">RSS</span>
              </a>
            </div>
    </div>
  </div>


      <footer class="post-footer">
          <div class="post-tags">
              <a href="/tags/Matlab/" rel="tag"># Matlab</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/02/11/hexo%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA%E6%95%99%E7%A8%8B/" rel="prev" title="hexo博客搭建教程">
      <i class="fa fa-chevron-left"></i> hexo博客搭建教程
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/02/12/%E7%BC%96%E7%A8%8B%E4%B8%8E%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD%E6%8E%A8%E8%8D%90%E4%B9%A6%E7%9B%AE%E4%BB%A5%E5%8F%8A%E5%AD%A6%E4%B9%A0%E8%B7%AF%E7%BA%BF/" rel="next" title="编程与人工智能推荐书目以及学习路线">
      编程与人工智能推荐书目以及学习路线 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  

  </div>


          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let activeClass = CONFIG.comments.activeClass;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-4"><a class="nav-link" href="#以下教程仅适用于win10环境，安装以Matlab-2017b为例"><span class="nav-number">1.</span> <span class="nav-text">以下教程仅适用于win10环境，安装以Matlab 2017b为例</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#一、Matlab的作用"><span class="nav-number"></span> <span class="nav-text">一、Matlab的作用</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#二、软件准备"><span class="nav-number"></span> <span class="nav-text">二、软件准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#三、正式安装"><span class="nav-number"></span> <span class="nav-text">三、正式安装</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#四、软件破解"><span class="nav-number"></span> <span class="nav-text">四、软件破解</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#五、软件激活"><span class="nav-number"></span> <span class="nav-text">五、软件激活</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#六、Matlab推荐材料"><span class="nav-number"></span> <span class="nav-text">六、Matlab推荐材料</span></a></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Alpha Yang"
      src="/images/IMG_1979(20200206-160439).JPG">
  <p class="site-author-name" itemprop="name">Alpha Yang</p>
  <div class="site-description" itemprop="description">世间万物，唯代码美食，不能辜负。</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">5</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">8</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">5</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>


<div style="">
  <canvas id="canvas" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
</div>
<script>
(function(){

   var digit=
    [
        [
            [0,0,1,1,1,0,0],
            [0,1,1,0,1,1,0],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,0,1,1,0],
            [0,0,1,1,1,0,0]
        ],//0
        [
            [0,0,0,1,1,0,0],
            [0,1,1,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [1,1,1,1,1,1,1]
        ],//1
        [
            [0,1,1,1,1,1,0],
            [1,1,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,0,0],
            [0,0,1,1,0,0,0],
            [0,1,1,0,0,0,0],
            [1,1,0,0,0,0,0],
            [1,1,0,0,0,1,1],
            [1,1,1,1,1,1,1]
        ],//2
        [
            [1,1,1,1,1,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,0,0],
            [0,0,1,1,1,0,0],
            [0,0,0,0,1,1,0],
            [0,0,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,1,1,0]
        ],//3
        [
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,1,0],
            [0,0,1,1,1,1,0],
            [0,1,1,0,1,1,0],
            [1,1,0,0,1,1,0],
            [1,1,1,1,1,1,1],
            [0,0,0,0,1,1,0],
            [0,0,0,0,1,1,0],
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,1,1]
        ],//4
        [
            [1,1,1,1,1,1,1],
            [1,1,0,0,0,0,0],
            [1,1,0,0,0,0,0],
            [1,1,1,1,1,1,0],
            [0,0,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,1,1,0]
        ],//5
        [
            [0,0,0,0,1,1,0],
            [0,0,1,1,0,0,0],
            [0,1,1,0,0,0,0],
            [1,1,0,0,0,0,0],
            [1,1,0,1,1,1,0],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,1,1,0]
        ],//6
        [
            [1,1,1,1,1,1,1],
            [1,1,0,0,0,1,1],
            [0,0,0,0,1,1,0],
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,0,0],
            [0,0,0,1,1,0,0],
            [0,0,1,1,0,0,0],
            [0,0,1,1,0,0,0],
            [0,0,1,1,0,0,0],
            [0,0,1,1,0,0,0]
        ],//7
        [
            [0,1,1,1,1,1,0],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,1,1,0],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,1,1,0]
        ],//8
        [
            [0,1,1,1,1,1,0],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [1,1,0,0,0,1,1],
            [0,1,1,1,0,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,0,1,1],
            [0,0,0,0,1,1,0],
            [0,0,0,1,1,0,0],
            [0,1,1,0,0,0,0]
        ],//9
        [
            [0,0,0,0,0,0,0],
            [0,0,1,1,1,0,0],
            [0,0,1,1,1,0,0],
            [0,0,1,1,1,0,0],
            [0,0,0,0,0,0,0],
            [0,0,0,0,0,0,0],
            [0,0,1,1,1,0,0],
            [0,0,1,1,1,0,0],
            [0,0,1,1,1,0,0],
            [0,0,0,0,0,0,0]
        ]//:
    ];

var canvas = document.getElementById('canvas');

if(canvas.getContext){
    var cxt = canvas.getContext('2d');
    //声明canvas的宽高
    var H = 100,W = 700;
    canvas.height = H;
    canvas.width = W;
    cxt.fillStyle = '#f00';
    cxt.fillRect(10,10,50,50);

    //存储时间数据
    var data = [];
    //存储运动的小球
    var balls = [];
    //设置粒子半径
    var R = canvas.height/20-1;
    (function(){
        var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
        //存储时间数字，由十位小时、个位小时、冒号、十位分钟、个位分钟、冒号、十位秒钟、个位秒钟这7个数字组成
        data.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
    })();

    /*生成点阵数字*/
    function renderDigit(index,num){
        for(var i = 0; i < digit[num].length; i++){
            for(var j = 0; j < digit[num][i].length; j++){
                if(digit[num][i][j] == 1){
                    cxt.beginPath();
                    cxt.arc(14*(R+2)*index + j*2*(R+1)+(R+1),i*2*(R+1)+(R+1),R,0,2*Math.PI);
                    cxt.closePath();
                    cxt.fill();
                }
            }
        }
    }

    /*更新时钟*/
    function updateDigitTime(){
        var changeNumArray = [];
        var temp = /(\d)(\d):(\d)(\d):(\d)(\d)/.exec(new Date());
        var NewData = [];
        NewData.push(temp[1],temp[2],10,temp[3],temp[4],10,temp[5],temp[6]);
        for(var i = data.length-1; i >=0 ; i--){
            //时间发生变化
            if(NewData[i] !== data[i]){
                //将变化的数字值和在data数组中的索引存储在changeNumArray数组中
                changeNumArray.push(i+'_'+(Number(data[i])+1)%10);
            }
        }
        //增加小球
        for(var i = 0; i< changeNumArray.length; i++){
            addBalls.apply(this,changeNumArray[i].split('_'));
        }
        data = NewData.concat();
    }

    /*更新小球状态*/
    function updateBalls(){
        for(var i = 0; i < balls.length; i++){
            balls[i].stepY += balls[i].disY;
            balls[i].x += balls[i].stepX;
            balls[i].y += balls[i].stepY;
            if(balls[i].x > W + R || balls[i].y > H + R){
                balls.splice(i,1);
                i--;
            }
        }
    }

    /*增加要运动的小球*/
    function addBalls(index,num){
        var numArray = [1,2,3];
        var colorArray =  ["#3BE","#09C","#A6C","#93C","#9C0","#690","#FB3","#F80","#F44","#C00"];
        for(var i = 0; i < digit[num].length; i++){
            for(var j = 0; j < digit[num][i].length; j++){
                if(digit[num][i][j] == 1){
                    var ball = {
                        x:14*(R+2)*index + j*2*(R+1)+(R+1),
                        y:i*2*(R+1)+(R+1),
                        stepX:Math.floor(Math.random() * 4 -2),
                        stepY:-2*numArray[Math.floor(Math.random()*numArray.length)],
                        color:colorArray[Math.floor(Math.random()*colorArray.length)],
                        disY:1
                    };
                    balls.push(ball);
                }
            }
        }
    }

    /*渲染*/
    function render(){
        //重置画布宽度，达到清空画布的效果
        canvas.height = 100;
        //渲染时钟
        for(var i = 0; i < data.length; i++){
            renderDigit(i,data[i]);
        }
        //渲染小球
        for(var i = 0; i < balls.length; i++){
            cxt.beginPath();
            cxt.arc(balls[i].x,balls[i].y,R,0,2*Math.PI);
            cxt.fillStyle = balls[i].color;
            cxt.closePath();
            cxt.fill();
        }
    }

    clearInterval(oTimer);
    var oTimer = setInterval(function(){
        //更新时钟
        updateDigitTime();
        //更新小球状态
        updateBalls();
        //渲染
        render();
    },50);
}

})();
</script>
      </div>
	  
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Alpha Yang</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v4.2.0
  </div>
  <span class="post-meta-divider">|</span>
  <div class="theme-info">主题 – <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.7.1
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  

  


  <script async src="/js/cursor/fireworks.js"></script>



</body>
</html>
